import React, {PureComponent} from "react";

// 装饰器为组件添加age属性
function addAge(Target: Function) {
  Target.prototype.age = 11
 }

 // 使用装饰器
 @addAge
 class Class extends React.Component {
  age?: number;
  render() {
    return(
      <a>我是类组件{this.age}</a>
     )
  }
  }

  export default Class;